<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link href="./css/api.css" rel="stylesheet"/>
  <link href="./css/element.css" rel="stylesheet"/>
  <link href="./css/base.css" rel="stylesheet"/>
  <title>评估</title>
  <style>
    .el-radio{
      display: block;
      background-color: #fff;
      margin-bottom: 1rem;
      text-align: center;
      padding: 1rem;
      color: #3F3F3F;
      width: 100%;
      border-radius: .4rem;
      box-shadow:0px 0px 10px 0px rgba(0,0,0,0.15);
    }.el-radio.is-checked{
      background-color: #FF3C3C;
    }.el-radio__input.is-checked+.el-radio__label{
      color: #fff;
    }.el-radio__input{
      display: none;
    }.el-radio-group{
      width: 80%;
      margin: 1rem;
    }
  </style>
</head>
<body>
  <div id="vm" v-cloak>
    <header class="x-header">
      <i class="el-icon-arrow-left x-closewin-icon" @click="closethiswin"></i>
      <div class="x-header-t">评估</div>
    </header>
    <div class="x-ass-box">
      <el-radio-group v-model="assradio">
        <el-radio :label="1">评估通过</el-radio>
        <el-radio :label="2">评估未通过</el-radio>
        <el-radio :label="3">留存</el-radio>
      </el-radio-group>

    </div>
    <div class="x-mana-btn" @click="goassessajax">下一步</div>
  </div>
  <script type="text/javascript" src="./script/vue.js"></script>
  <script type="text/javascript" src="./script/element.js"></script>
  <script type="text/javascript" src="./script/api.js"></script>
  <script type="text/javascript" src="./js/base.js"></script>
  <script>
    apiready = function () {
      var middata = api.pageParam.id;
      console.log(middata);
      //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          assradio:0,
          midmid:''
        }
      },
      created:function() {
        var that=this;

      },
      mounted:function(){
        var that=this;
        that.midmid = middata;
      },
      methods: {
        goassessajax:function(){
          var that=this;
          console.log(that.assradio);
          if(that.assradio==1){
            openmanawin('asseaamentform','asseaamentform.html',that.midmid)
          }else if(that.assradio==2){
            that.noonpass(that.assradio)
          }else if(that.assradio==3){
            that.noonpass(that.assradio)
          }
        },
        noonpass:function(type){
          console.log(type);
          var that=this;
          api.ajax({
            url:manaurltwo+'screen',
            methods:'get',
            data:{
              values:{
                sec:$api.getStorage('usertoken'),
                mid:that.midmid,
                type:type
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                api.sendEvent({
                    name: 'assessmentok',
                    extra: {}
                });
                if(that.assradio==2){
                  openmanawin('submitreview','submitreview.html','assno')
                }
                if(that.assradio==3){
                  openmanawin('submitreview','submitreview.html','asson')
                }

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
      }
    })
    }
  </script>
</body>
</html>
